import {useState,useEffect} from 'react'
import Router from '@/routes'
import NavBar from '@/components/NavBar'
import {useLocation} from 'react-router-dom'

// 基调色，主题色
import {ConfigProvider} from 'zarm'


function App() {
  const [showNav,setShowNav] =useState(false)
  const needNav=['/','/data','/user']
  // const pathname=window.location.pathname
  const {pathname}=useLocation()

  useEffect(()=>{
    setShowNav(needNav.includes(pathname))
  },[pathname])
  return (
    <ConfigProvider primaryColor='#007fff'>
      <>
      <Router></Router>
      <NavBar showNav={showNav}></NavBar>
      </>
    </ConfigProvider>
  )
}

export default App
